
#pragma once
#include <vector>
using std::vector;

#include "..\Game Objects\IBaseInterface.h"

class DHD_ObjectManager
{
private:
	// Constructor and Trilogy
	DHD_ObjectManager() {}
	~DHD_ObjectManager();
	DHD_ObjectManager(const DHD_ObjectManager&);
	DHD_ObjectManager& operator=(const DHD_ObjectManager&);

	// Singleton Pointer
	static DHD_ObjectManager* sm_pInstance;

	// Member Variables
	vector<IBaseInterface*> m_vObjectList;

public:
	static DHD_ObjectManager* GetInstance() 
	{
		if (!sm_pInstance)
			sm_pInstance = new DHD_ObjectManager();

		return sm_pInstance; 
	}

	static void DeleteInstance()
	{
		if (sm_pInstance)
		{
			sm_pInstance->RemoveAllObjects();
			delete sm_pInstance;
			sm_pInstance = NULL;
		}
	}

	void UpdateObjects(float _fDT);
	void RenderObjects(void);

	void AddObject(IBaseInterface* pObject);
	void RemoveObject(IBaseInterface* pObject);

	void RemoveAllObjects(void);

	void CheckCollisions();

};